<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"vchao.top","root":"/","scheme":"Muse","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="&gt; 安卓的权限特别多，这里简单总结一下，以作备忘。 前言在安卓6.0之前，所有权限只要声明即可。从安卓6.0开始，权限就进行了分级，高危权限需要在代码中进行动态申请。除了可以代码中申请的权限外，还有一些权限需要用户手动开启。例如悬浮窗权限，安装未知来源应用权限。此外还有一个方法，可以免除权限的申请，就是开启设备管理器。 动态权限动态权限的申请在Activity和fragment的操作不一样">
<meta property="og:type" content="article">
<meta property="og:title" content="安卓基础权限总结">
<meta property="og:url" content="http://vchao.top/2018/04/03/%E5%AE%89%E5%8D%93%E5%9F%BA%E7%A1%80%E6%9D%83%E9%99%90%E6%80%BB%E7%BB%93/index.html">
<meta property="og:site_name" content="乘风破浪">
<meta property="og:description" content="&gt; 安卓的权限特别多，这里简单总结一下，以作备忘。 前言在安卓6.0之前，所有权限只要声明即可。从安卓6.0开始，权限就进行了分级，高危权限需要在代码中进行动态申请。除了可以代码中申请的权限外，还有一些权限需要用户手动开启。例如悬浮窗权限，安装未知来源应用权限。此外还有一个方法，可以免除权限的申请，就是开启设备管理器。 动态权限动态权限的申请在Activity和fragment的操作不一样">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2018-04-03T02:30:56.000Z">
<meta property="article:modified_time" content="2021-08-25T14:37:20.800Z">
<meta property="article:author" content="vchao">
<meta property="article:tag" content="Android">
<meta property="article:tag" content="权限">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://vchao.top/2018/04/03/%E5%AE%89%E5%8D%93%E5%9F%BA%E7%A1%80%E6%9D%83%E9%99%90%E6%80%BB%E7%BB%93/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>安卓基础权限总结 | 乘风破浪</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">乘风破浪</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://vchao.top/2018/04/03/%E5%AE%89%E5%8D%93%E5%9F%BA%E7%A1%80%E6%9D%83%E9%99%90%E6%80%BB%E7%BB%93/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="vchao">
      <meta itemprop="description" content="怀揣好奇，梦想改变世界的菜鸟极客">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="乘风破浪">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          安卓基础权限总结
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2018-04-03 10:30:56" itemprop="dateCreated datePublished" datetime="2018-04-03T10:30:56+08:00">2018-04-03</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2021-08-25 22:37:20" itemprop="dateModified" datetime="2021-08-25T22:37:20+08:00">2021-08-25</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Android/" itemprop="url" rel="index"><span itemprop="name">Android</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>﻿&gt; 安卓的权限特别多，这里简单总结一下，以作备忘。</p>
<h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><p>在安卓6.0之前，所有权限只要声明即可。<br>从安卓6.0开始，权限就进行了分级，高危权限需要在代码中进行动态申请。<br>除了可以代码中申请的权限外，还有一些权限需要用户手动开启。例如悬浮窗权限，安装未知来源应用权限。<br>此外还有一个方法，可以免除权限的申请，就是开启设备管理器。</p>
<h2 id="动态权限"><a href="#动态权限" class="headerlink" title="动态权限"></a>动态权限</h2><p>动态权限的申请在Activity和fragment的操作不一样。需要注意以下。</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 1.Activtity 申请权限</span></span><br><span class="line"><span class="keyword">if</span>(ContextCompat.checkSelfPermission(XXX.<span class="keyword">this</span>,Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED)&#123;</span><br><span class="line">     <span class="comment">//没有权限</span></span><br><span class="line">     ActivityCompat.requestPermissions(XXX.<span class="keyword">this</span>,<span class="keyword">new</span> String[]&#123;</span><br><span class="line">                                    Manifest.permission.WRITE_EXTERNAL_STORAGE&#125;,<span class="number">1</span>);</span><br><span class="line">&#125;<span class="keyword">else</span> &#123;</span><br><span class="line">     <span class="comment">// 有权限 ...</span></span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">// 2. Fragment 申请权限</span></span><br><span class="line"><span class="keyword">if</span>(ContextCompat.checkSelfPermission(getActivity(),Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED)&#123;</span><br><span class="line">		<span class="comment">//没有权限</span></span><br><span class="line">          requestPermissions(<span class="keyword">new</span> String[]&#123;</span><br><span class="line">                                    Manifest.permission.WRITE_EXTERNAL_STORAGE&#125;,<span class="number">1</span>);</span><br><span class="line">&#125;<span class="keyword">else</span> &#123;</span><br><span class="line">       <span class="comment">// 有权限 ...</span></span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">// 3. 权限返回</span></span><br><span class="line"> <span class="meta">@Override</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">onRequestPermissionsResult</span><span class="params">(<span class="keyword">int</span> requestCode, String[] permissions, <span class="keyword">int</span>[] grantResults)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">super</span>.onRequestPermissionsResult(requestCode, permissions, grantResults);</span><br><span class="line">        <span class="keyword">switch</span> (requestCode)&#123;</span><br><span class="line">            <span class="keyword">case</span> <span class="number">1</span>:</span><br><span class="line">                <span class="keyword">if</span>(grantResults.length &gt; <span class="number">0</span> &amp;&amp; grantResults[<span class="number">0</span>] == PackageManager.PERMISSION_GRANTED)&#123;</span><br><span class="line">                    <span class="comment">// 允许了权限 ...</span></span><br><span class="line">                &#125;<span class="keyword">else</span>&#123;</span><br><span class="line">                	<span class="comment">// 拒绝了权限 ...</span></span><br><span class="line">                &#125;</span><br><span class="line">                <span class="keyword">break</span>;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br></pre></td></tr></table></figure>
<p>Fragment中运行时权限的特殊处理<br>在Fragment中申请权限，不要使用ActivityCompat.requestPermissions, 直接使用Fragment的requestPermissions方法，否则会回调到Activity的 onRequestPermissionsResult<br>如果在Fragment中嵌套Fragment，在子Fragment中使用requestPermissions方 法，onRequestPermissionsResult不会回调回来，建议使用 getParentFragment().requestPermissions方法，这个方法会回调到父Fragment中的onRequestPermissionsResult，加入以下代码可以把回调透传到子Fragment</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">@Override</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">onRequestPermissionsResult</span><span class="params">(<span class="keyword">int</span> requestCode, String[] permissions, <span class="keyword">int</span>[] grantResults)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">super</span>.onRequestPermissionsResult(requestCode, permissions, grantResults);</span><br><span class="line">        List&lt;Fragment&gt; fragments = getChildFragmentManager().getFragments();</span><br><span class="line">        <span class="keyword">if</span> (fragments != <span class="keyword">null</span>) &#123;</span><br><span class="line">            <span class="keyword">for</span> (Fragment fragment : fragments) &#123;</span><br><span class="line">                <span class="keyword">if</span> (fragment != <span class="keyword">null</span>) &#123;</span><br><span class="line">                  fragment.onRequestPermissionsResult(requestCode,permissions,grantResults);</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br></pre></td></tr></table></figure>

<h2 id="权限列表"><a href="#权限列表" class="headerlink" title="权限列表"></a>权限列表</h2><table>
<thead>
<tr>
<th>权限</th>
<th>说明</th>
</tr>
</thead>
<tbody><tr>
<td>android.permission.INTERNET，</td>
<td>访问网络连接，可能产生GPRS流量</td>
</tr>
<tr>
<td>android.permission.CHANGE_WIFI_STATE</td>
<td>Wifi 改变状态</td>
</tr>
<tr>
<td>android.permission.ACCESS_WIFI_STATE</td>
<td>WiFi 状态</td>
</tr>
<tr>
<td>android.permission.ACCESS_NETWORK_STATE</td>
<td>网络状态</td>
</tr>
<tr>
<td>android.permission.CAMERA</td>
<td>相机</td>
</tr>
<tr>
<td>android.permission.RECORD_AUDIO</td>
<td>自动聚焦</td>
</tr>
<tr>
<td>android.permission.WRITE_EXTERNAL_STORAGE</td>
<td>写内存</td>
</tr>
<tr>
<td>android.permission.CWJ_GROUP</td>
<td>底层访问权限，允许CWJ账户组访问底层信息</td>
</tr>
<tr>
<td>android.permission.CELL_PHONE_MASTER_EX</td>
<td>手机优化大师扩展权限</td>
</tr>
<tr>
<td>android.permission.CONTROL_LOCATION_UPDATES</td>
<td>控制定位更新，允许获得移动网络定位信息改变</td>
</tr>
<tr>
<td>android.permission.DELETE_CACHE_FILES</td>
<td>删除缓存文件,允许应用删除缓存文件</td>
</tr>
<tr>
<td>android.permission.DELETE_PACKAGES</td>
<td>允许程序删除应用</td>
</tr>
<tr>
<td>android.permission.DEVICE_POWER</td>
<td>允许访问底层电源管理</td>
</tr>
<tr>
<td>android.permission.DIAGNOSTIC</td>
<td>允许程序到RW到诊断资源</td>
</tr>
<tr>
<td>android.permission.DISABLE_KEYGUARD</td>
<td>允许程序禁用键盘锁</td>
</tr>
<tr>
<td>android.permission.DUMP</td>
<td>允许程序获取系统dump信息从系统服务</td>
</tr>
<tr>
<td>android.permission.EXPAND_STATUS_BAR</td>
<td>允许程序扩展或收缩状态栏</td>
</tr>
<tr>
<td>android.permission.FACTORY_TEST</td>
<td>允许程序运行工厂测试模式</td>
</tr>
<tr>
<td>android.permission.FLASHLIGHT</td>
<td>允许访问闪光灯</td>
</tr>
<tr>
<td>android.permission.FORCE_BACK</td>
<td>允许程序强制使用back后退按键无论Activity是否在顶层</td>
</tr>
<tr>
<td>android.permission.GET_ACCOUNTS</td>
<td>访问GMail账户列表</td>
</tr>
<tr>
<td>android.permission.GET_PACKAGE_SIZE</td>
<td>获取应用的文件大小</td>
</tr>
<tr>
<td>android.permission.GET_TASKS</td>
<td>允许程序获取当前或最近运行的应用</td>
</tr>
<tr>
<td>android.permission.GLOBAL_SEARCH</td>
<td>允许程序使用全局搜索功能</td>
</tr>
<tr>
<td>android.permission.HARDWARE_TEST</td>
<td>访问硬件辅助设备用于硬件测试</td>
</tr>
<tr>
<td>android.permission.INJECT_EVENTS</td>
<td>允许访问本程序的底层事件，获取按键、轨迹球的事件流</td>
</tr>
<tr>
<td>android.permission.INSTALL_LOCATION_PROVIDER</td>
<td>安装定位提供</td>
</tr>
<tr>
<td>android.permission.INSTALL_PACKAGES</td>
<td>允许程序安装应用</td>
</tr>
<tr>
<td>android.permission.INTERNAL_SYSTEM_WINDOW</td>
<td>允许程序打开内部窗口不对第三方应用程序开放此权限</td>
</tr>
<tr>
<td>android.permission.KILL_BACKGROUND_PROCESSES</td>
<td>允许程序调用killBackgroundProcesses(String).方法结束后台进程</td>
</tr>
<tr>
<td>android.permission.MANAGE_ACCOUNTS</td>
<td>允许程序管理AccountManager中的账户列表</td>
</tr>
<tr>
<td>android.permission.MANAGE_APP_TOKENS</td>
<td>管理创建、摧毁、Z轴顺序仅用于系统</td>
</tr>
<tr>
<td>android.permission.MTWEAK_USER</td>
<td>允许mTweak用户访问高级系统权限</td>
</tr>
<tr>
<td>android.permission.MTWEAK_FORUM</td>
<td>允许使用mTweak社区权限</td>
</tr>
<tr>
<td>android.permission.MASTER_CLEAR</td>
<td>允许程序执行软格式化 删除系统配置信息</td>
</tr>
<tr>
<td>android.permission.MODIFY_AUDIO_SETTINGS</td>
<td>修改声音设置信息</td>
</tr>
<tr>
<td>android.permission.MODIFY_PHONE_STATE</td>
<td>修改电话状态,如飞行模式，但不包含替换系统拨号器界面</td>
</tr>
<tr>
<td>android.permission.MOUNT_FORMAT_FILESYSTEMS</td>
<td>格式化可移动文件系统，比如格式化清空SD卡</td>
</tr>
<tr>
<td>android.permission.MOUNT_UNMOUNT_FILESYSTEMS</td>
<td>挂载、反挂载外部文件系统</td>
</tr>
<tr>
<td>android.permission.NFC</td>
<td>允许程序执行NFC近距离通讯操作,用于移动支持</td>
</tr>
<tr>
<td>android.permission.PERSISTENT_ACTIVITY</td>
<td>创建一个永久的Activity该功能标记为将来将被移除</td>
</tr>
<tr>
<td>android.permission.PROCESS_OUTGOING_CALLS</td>
<td>允许程序监视修改或放弃播出电话</td>
</tr>
<tr>
<td>android.permission.READ_CALENDAR</td>
<td>允许程序读取用户的日程信息</td>
</tr>
<tr>
<td>android.permission.READ_CONTACTS</td>
<td>允许应用访问联系人通讯录信息</td>
</tr>
<tr>
<td>android.permission.READ_FRAME_BUFFER</td>
<td>读取帧缓存用于屏幕截图</td>
</tr>
<tr>
<td>com.android.browser.permission.READ_HISTORY_BOOKMARKS</td>
<td>读取浏览器收藏夹和历史记录</td>
</tr>
<tr>
<td>android.permission.READ_INPUT_STATE</td>
<td>读取当前键的输入状态，仅用于系统</td>
</tr>
<tr>
<td>android.permission.READ_LOGS</td>
<td>读取系统底层日志</td>
</tr>
<tr>
<td>android.permission.READ_PHONE_STATE</td>
<td>访问电话状态</td>
</tr>
<tr>
<td>android.permission.READ_SMS</td>
<td>读取短信内容</td>
</tr>
<tr>
<td>android.permission.READ_SYNC_SETTINGS</td>
<td>读取同步设置，读取Google在线同步设置</td>
</tr>
<tr>
<td>android.permission.READ_SYNC_STATS</td>
<td>读取同步状态，获得Google在线同步状态</td>
</tr>
<tr>
<td>android.permission.REBOOT</td>
<td>允许程序重新启动设备</td>
</tr>
<tr>
<td>android.permission.RECEIVE_BOOT_COMPLETED</td>
<td>允许程序开机自动运行</td>
</tr>
<tr>
<td>android.permission.RECEIVE_MMS</td>
<td>接收彩信</td>
</tr>
<tr>
<td>android.permission.RECEIVE_SMS</td>
<td>接收短信</td>
</tr>
<tr>
<td>android.permission.RECEIVE_WAP_PUSH</td>
<td>接收WAP PUSH信息</td>
</tr>
<tr>
<td>android.permission.RECORD_AUDIO</td>
<td>录制声音通过手机或耳机的麦克</td>
</tr>
<tr>
<td>android.permission.REORDER_TASKS</td>
<td>重新排序系统Z轴运行中的任务</td>
</tr>
<tr>
<td>android.permission.RESTART_PACKAGES</td>
<td>结束任务通过restartPackage(String)方法,该方式将在外来放弃</td>
</tr>
<tr>
<td>android.permission.SEND_SMS</td>
<td>发送短信</td>
</tr>
<tr>
<td>android.permission.SET_ACTIVITY_WATCHER</td>
<td>设置Activity观察器一般用于monkey测试</td>
</tr>
<tr>
<td>com.android.alarm.permission.SET_ALARM</td>
<td>设置闹铃提醒</td>
</tr>
<tr>
<td>android.permission.SET_ALWAYS_FINISH</td>
<td>设置程序在后台是否总是退出</td>
</tr>
<tr>
<td>android.permission.SET_ANIMATION_SCALE</td>
<td>设置全局动画缩放</td>
</tr>
<tr>
<td>android.permission.SET_DEBUG_APP</td>
<td>设置调试程序,一般用于开发</td>
</tr>
<tr>
<td>android.permission.SET_ORIENTATION</td>
<td>设置屏幕方向为横屏或标准方式显示,不用于普通应用</td>
</tr>
<tr>
<td>android.permission.SET_PREFERRED_APPLICATIONS</td>
<td>设置应用的参数,已不再工作具体查看addPackageToPreferred(String)介绍</td>
</tr>
<tr>
<td>android.permission.SET_PROCESS_LIMIT</td>
<td>允许程序设置最大的进程数量的限制</td>
</tr>
<tr>
<td>android.permission.SET_TIME</td>
<td>设置系统时间</td>
</tr>
<tr>
<td>android.permission.SET_TIME_ZONE</td>
<td>设置系统时区</td>
</tr>
<tr>
<td>android.permission.SET_WALLPAPER</td>
<td>设置桌面壁纸</td>
</tr>
<tr>
<td>android.permission.SET_WALLPAPER_HINTS</td>
<td>设置壁纸建议</td>
</tr>
<tr>
<td>android.permission.SIGNAL_PERSISTENT_PROCESSES</td>
<td>发送一个永久的进程信号</td>
</tr>
<tr>
<td>android.permission.STATUS_BAR</td>
<td>允许程序打开、关闭、禁用状态栏</td>
</tr>
<tr>
<td>android.permission.SUBSCRIBED_FEEDS_READ</td>
<td>访问订阅信息的数据库</td>
</tr>
<tr>
<td>android.permission.SUBSCRIBED_FEEDS_WRITE</td>
<td>写入或修改订阅内容的数据库</td>
</tr>
<tr>
<td>android.permission.SYSTEM_ALERT_WINDOW</td>
<td>显示系统窗口</td>
</tr>
<tr>
<td>android.permission.UPDATE_DEVICE_STATS</td>
<td>更新设备状态</td>
</tr>
<tr>
<td>android.permission.USE_CREDENTIALS</td>
<td>允许程序请求验证从AccountManager</td>
</tr>
<tr>
<td>android.permission.USE_SIP</td>
<td>允许程序使用SIP视频服务</td>
</tr>
<tr>
<td>android.permission.VIBRATE</td>
<td>允许振动</td>
</tr>
<tr>
<td>android.permission.WAKE_LOCK</td>
<td>允许程序在手机屏幕关闭后后台进程仍然运行</td>
</tr>
<tr>
<td>android.permission.WRITE_APN_SETTINGS</td>
<td>写入网络GPRS接入点设置</td>
</tr>
<tr>
<td>android.permission.WRITE_CALENDAR</td>
<td>写入日程,但不可读取</td>
</tr>
<tr>
<td>android.permission.WRITE_CONTACTS</td>
<td>写入联系人,但不可读取</td>
</tr>
<tr>
<td>android.permission.WRITE_EXTERNAL_STORAGE</td>
<td>允许程序写入外部存储,如SD卡上写文件</td>
</tr>
<tr>
<td>android.permission.WRITE_GSERVICES</td>
<td>允许程序写入Google Map服务数据</td>
</tr>
<tr>
<td>com.android.browser.permission.WRITE_HISTORY_BOOKMARKS</td>
<td>写入浏览器历史记录或收藏夹.但不可读取</td>
</tr>
<tr>
<td>android.permission.WRITE_SECURE_SETTINGS</td>
<td>允许程序读写系统安全敏感的设置项</td>
</tr>
<tr>
<td>android.permission.WRITE_SETTINGS</td>
<td>允许读写系统设置项</td>
</tr>
<tr>
<td>android.permission.WRITE_SMS</td>
<td>允许编写短信</td>
</tr>
<tr>
<td>android.permission.WRITE_SYNC_SETTINGS</td>
<td>写入Google在线同步设置</td>
</tr>
<tr>
<td>android.permission.ACCESS_CHECKIN_PROPERTIES</td>
<td>读取或写入登记check-in数据库属性表的权限</td>
</tr>
<tr>
<td>android.permission.ACCESS_COARSE_LOCATION</td>
<td>通过WiFi或移动基站的方式获取用户错略的经纬度信息，定位精度大概误差在30~1500米</td>
</tr>
<tr>
<td>android.permission.ACCESS_FINE_LOCATION</td>
<td>通过GPS芯片接收卫星的定位信息,定位精度达10米以内</td>
</tr>
<tr>
<td>android.permission.ACCESS_LOCATION_EXTRA_COMMANDS</td>
<td>允许程序访问额外的定位提供者指令</td>
</tr>
<tr>
<td>android.permission.ACCESS_MOCK_LOCATION</td>
<td>获取模拟定位信息，一般用于帮助开发者调试应用</td>
</tr>
<tr>
<td>android.permission.ACCESS_NETWORK_STATE</td>
<td>获取网络信息状态，如当前的网络连接是否有效</td>
</tr>
<tr>
<td>android.permission.ACCESS_SURFACE_FLINGER</td>
<td>Android平台上底层的图形显示支持，一般用于游戏或照相机预览界面和底层模式的屏幕截图</td>
</tr>
<tr>
<td>android.permission.ACCESS_WIFI_STATE</td>
<td>获取当前WiFi接入的状态以及WLAN热点的信息</td>
</tr>
<tr>
<td>android.permission.ACCOUNT_MANAGER</td>
<td>获取账户验证信息主要为GMail账户信息，只有系统级进程才能访问的权限</td>
</tr>
<tr>
<td>android.permission.AUTHENTICATE_ACCOUNTS</td>
<td>允许一个程序通过账户验证方式访问账户管理ACCOUNT_MANAGER相关信息</td>
</tr>
<tr>
<td>android.permission.BATTERY_STATS</td>
<td>获取电池电量统计信息</td>
</tr>
<tr>
<td>android.permission.BIND_APPWIDGET</td>
<td>允许一个程序告诉appWidget服务需要访问小插件的数据库只有非常少的应用才用到此权限</td>
</tr>
<tr>
<td>android.permission.BIND_DEVICE_ADMIN</td>
<td>请求系统管理员接收者receiver，只有系统才能使用</td>
</tr>
<tr>
<td>android.permission.BIND_INPUT_METHOD</td>
<td>请求InputMethodService服务只有系统才能使用</td>
</tr>
<tr>
<td>android.permission.BIND_REMOTEVIEWS</td>
<td>必须通过RemoteViewsService服务来请求，只有系统才能用</td>
</tr>
<tr>
<td>android.permission.BIND_WALLPAPER</td>
<td>必须通过WallpaperService服务来请求，只有系统才能用</td>
</tr>
<tr>
<td>android.permission.BLUETOOTH</td>
<td>允许程序连接配对过的蓝牙设备</td>
</tr>
<tr>
<td>android.permission.BLUETOOTH_ADMIN</td>
<td>允许程序进行发现和配对新的蓝牙设备</td>
</tr>
<tr>
<td>android.permission.BRICK</td>
<td>能够禁用手机，非常危险，顾名思义就是让手机变成砖头</td>
</tr>
<tr>
<td>android.permission.BROADCAST_PACKAGE_REMOVED</td>
<td>当一个应用在删除时触发一个广播</td>
</tr>
<tr>
<td>android.permission.BROADCAST_SMS</td>
<td>当收到短信时触发一个广播</td>
</tr>
<tr>
<td>android.permission.BROADCAST_STICKY</td>
<td>允许一个程序收到广播后快速收到下一个广播</td>
</tr>
<tr>
<td>android.permission.BROADCAST_WAP_PUSH</td>
<td>WAP PUSH服务收到后触发一个广播</td>
</tr>
<tr>
<td>android.permission.CALL_PHONE</td>
<td>允许程序从非系统拨号器里输入电话号码</td>
</tr>
<tr>
<td>android.permission.CALL_PRIVILEGED</td>
<td>允许程序拨打电话，替换系统的拨号器界面</td>
</tr>
<tr>
<td>android.permission.CAMERA</td>
<td>允许访问摄像头进行拍照</td>
</tr>
<tr>
<td>android.permission.CHANGE_COMPONENT_ENABLED_STATE</td>
<td>改变组件是否启用状态</td>
</tr>
<tr>
<td>android.permission.CHANGE_CONFIGURATION</td>
<td>允许当前应用改变配置，如定位</td>
</tr>
<tr>
<td>android.permission.CHANGE_NETWORK_STATE</td>
<td>改变网络状态如是否能联网</td>
</tr>
<tr>
<td>android.permission.CHANGE_WIFI_MULTICAST_STATE</td>
<td>改变WiFi多播状态</td>
</tr>
<tr>
<td>android.permission.CHANGE_WIFI_STATE</td>
<td>改变WiFi状态</td>
</tr>
<tr>
<td>android.permission.CLEAR_APP_CACHE</td>
<td>清除应用缓存</td>
</tr>
<tr>
<td>android.permission.CLEAR_APP_USER_DATA</td>
<td>清除应用的用户数据</td>
</tr>
</tbody></table>
<p>参考：<br><a target="_blank" rel="noopener" href="https://blog.csdn.net/koma025/article/details/52913511">https://blog.csdn.net/koma025/article/details/52913511</a></p>

    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/Android/" rel="tag"># Android</a>
              <a href="/tags/%E6%9D%83%E9%99%90/" rel="tag"># 权限</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2018/03/19/%E5%AE%89%E5%8D%93%EF%BC%9A%E4%BB%8E%E7%BD%91%E9%A1%B5%E5%94%A4%E9%86%92APP/" rel="prev" title="安卓：从网页唤醒APP">
      <i class="fa fa-chevron-left"></i> 安卓：从网页唤醒APP
    </a></div>
      <div class="post-nav-item">
    <a href="/2018/04/12/%E6%89%8B%E6%8A%8A%E6%89%8B%E5%B8%A6%E4%BD%A0%E6%92%B8%E4%B8%80%E4%B8%AA%E6%A0%A1%E5%9B%ADAPP%EF%BC%88%E4%B8%89%EF%BC%89%EF%BC%9A%E7%94%A8%E6%88%B7%E6%A8%A1%E5%9D%97%EF%BC%88%E7%99%BB%E5%BD%95%E6%B3%A8%E5%86%8C%E7%AD%89%EF%BC%89/" rel="next" title="手把手带你撸一个校园APP（三）：用户模块（登录注册等）">
      手把手带你撸一个校园APP（三）：用户模块（登录注册等） <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%89%8D%E8%A8%80"><span class="nav-number">1.</span> <span class="nav-text">前言</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%8A%A8%E6%80%81%E6%9D%83%E9%99%90"><span class="nav-number">2.</span> <span class="nav-text">动态权限</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%9D%83%E9%99%90%E5%88%97%E8%A1%A8"><span class="nav-number">3.</span> <span class="nav-text">权限列表</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">vchao</p>
  <div class="site-description" itemprop="description">怀揣好奇，梦想改变世界的菜鸟极客</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">46</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
        <span class="site-state-item-count">4</span>
        <span class="site-state-item-name">分类</span>
      </div>
      <div class="site-state-item site-state-tags">
        <span class="site-state-item-count">27</span>
        <span class="site-state-item-name">标签</span>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        
  <div class="beian"><a href="https://beian.miit.gov.cn/" rel="noopener" target="_blank">冀ICP备 17022751号-1 </a>
      <img src="https://beian.miit.gov.cn" style="display: inline-block;">
  </div>

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">vchao</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://muse.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/muse.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  

</body>
</html>
